package com.xh.bussiness.permission.controller;

import com.xh.bussiness.permission.service.IIndexStatisticsService;
import com.xh.core.bean.AjaxResult;
import com.xh.core.constant.AjaxResultConstant;
import com.xh.core.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "首页统计接口")
@RestController
@RequestMapping("/permission/indexStatistics")
public class IndexStatisticsController extends BaseController {

    @Autowired
    private IIndexStatisticsService indexStatisticsService;

    @ApiOperation(value = "教研统计", notes = "教研统计")
    @GetMapping("/teachResearchStatistics")
    public AjaxResult teachResearchStatistics(String userId) {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, "", indexStatisticsService.teachResearchStatistics(userId));
    }

    @ApiOperation(value = "备课统计", notes = "备课统计")
    @GetMapping("/prepareLessonsStatistics")
    public AjaxResult prepareLessonsStatistics(String userId) {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, "", indexStatisticsService.prepareLessonsStatistics(userId));
    }
}
